package com.lebang.mapper;

import com.lebang.configuration.datasource.DataSource;
import com.lebang.domain.CencesEarnDay;
import com.lebang.domain.TaskWorthRecord;
import com.lebang.example.CencesEarnDayExample;
import org.apache.ibatis.annotations.Mapper;
import com.lebang.domain.DownloadMemberRecord;
import java.util.List;
import org.apache.ibatis.annotations.Param;

import javax.annotation.ParametersAreNonnullByDefault;
import java.time.LocalDateTime;

/**
 * CencesEarnDayMapper继承基类
 */
@Mapper
public interface CencesEarnDayMapper extends MyBatisBaseDao<CencesEarnDay, Integer, CencesEarnDayExample> {

    @DataSource("commonDB")
    CencesEarnDay sumData(@Param("star") Integer star, @Param("end") Integer end, @Param("appStore") String appStore, @Param("category") int category, @Param("type") int type, @Param("sdkKey") String sdkKey, @Param("likeBrand") String likeBrand, @Param("appId") Integer appId);

    @DataSource("commonDB")
    List<DownloadMemberRecord> selectAllData(@Param("appStore") String appStore, @Param("star") LocalDateTime star, @Param("end") LocalDateTime end, @Param("sdkKey") String sdkKey);

    @DataSource("commonDB")
    CencesEarnDay selectBySdkTime(@Param("sdkKey") String sdkKey, @Param("time") Integer time, @Param("appId") Integer appId);

    @DataSource("commonDB")
    int insertEarnDay(CencesEarnDay allVo);

    @DataSource("commonDB")
    List<CencesEarnDay> selectGroupbyTime(@Param("list") List<TaskWorthRecord> recordList,@Param("appId") Integer appId);

    @DataSource("commonDB")
    CencesEarnDay selectBySdkTimeAppStore(@Param("sdkKey") String sdkKey, @Param("time") Integer time, @Param("appId") Integer appId,@Param("appStore") String appStore);
}